
module.exports = function ($scope, $state, $stateParams,$resource,$modal,items,$modalInstance,FileUploader) {
  console.log(items);
  console.log('上面是items')
  if (items.flag == '1'){
    $scope.flag = '1';
  }
  $scope.a = {
    'recommend_type_name' : ''
  }
  if(items){
    $scope.a=items;
  }
  $scope.obj = {
    'isSelected' : ''
  }
  $scope.applyarr=[
      {name:'区县项目',value:'0'},
      {name:'市级项目',value:'1'},
  ]
  // 责任处室
  $scope.officeFileArr = [
    {name:'规划发展处',value:'3', id : ['8', '9']},
    {name:'行业管理处  ',value:'6', id : ['3', '4']},
    {name:'人事编制处 ',value:'1', id : ['1', '2']},
    {name:'政策法规处 ',value:'2', id : ['3', '4']},
    {name:'区域合作处',value:'4', id : ['5', '6', '7']},
    {name:'市场开发处 ',value:'5', id : ['1', '2']},
    {name:'产业发展处',value:'7', id : ['8', '9']},
    {name:'特色旅游处',value:'8', id : ['5', '6', '7']},
    {name:'旅游质量监督管理所',value:'9', id : ['3', '4']},
    {name:'旅游产业发展服务中心',value:'10', id : ['8', '9']},
    {name:'机关党委',value:'11', id : ['5', '6', '7']},
    {name:'办公室',value:'12', id : ['5', '6', '7']}
]
  // 公告类型
$scope.typeFileArr = [
    {name:'旅游龙头项目',value:'0', id : '1'},
    {name:'旅游集聚区项目',value:'1', id : '2'},
    {name:'旅游集群项目',value:'2', id : '3'},
    {name:'全域旅游示范区项目',value:'3', id : '4'},
    {name:'特色旅游休闲街区项目',value:'4', id : '5'},
    {name:'特色旅游产业园区项目',value:'5', id : '6'},
    {name:'特色旅游人才培训基地项目',value:'6', id : '7'},
    {name:'特色旅游创客孵化基地项目',value:'7', id : '8'},
    {name:'离境退税项目',value:'8', id : '9'},
    {name:'景区提升工程项目',value:'9', id : '1'},
    {name:'旅游度假区项目',value:'10', id : '2'},
    {name:'乡村旅游项目',value:'11', id : '3'},
    {name:'旅游公共服务体系项目',value:'12', id : '4'},
    {name:'旅游公共交通体系项目',value:'13', id : '5'},
    {name:'旅游智慧化项目',value:'14', id : '6'},
    {name:'旅游节庆活动项目',value:'15', id : '7'},
    {name:'旅游展示活动项目',value:'16', id : '8'},
    {name:'旅游惠民活动项目',value:'17', id : '9'},
    {name:'旅游体制改革项目',value:'18', id : '8'},
    {name:'旅游招徕补贴项目',value:'19', id : '9'},
    {name:'旅游品牌奖励项目',value:'20', id : '1'},
    {name:'宣传营销项目',value:'21', id : '2'},
    {name:'旅游产品研发项目',value:'22', id : '3'},
    {name:'课题调查研究项目',value:'23', id : '4'},
    {name:'区域旅游合作项目',value:'24', id : '5'},
    {name:'旅游招商项目',value:'25', id : '6'},
    {name:'行业管理项目',value:'26', id : '7'},
    {name:'满意度评价项目',value:'27', id : '8'},
    {name:'其他项目',value:'28', id : '9'}     
]
  if ($scope.a.recommend_type != undefined){
    for (var i = 0; i < $scope.officeFileArr.length; i++){
      if($scope.a.recommend_type == $scope.officeFileArr[i].value){
          $scope.a.recommend_type_name = $scope.officeFileArr[i].name;
      }
    }
  }
  // 图片
  if ($scope.a.guide_pdf != undefined){
    $scope.imagearr = $scope.a.guide_pdf.split(',');
    for(var i = 0;i<$scope.imagearr.length;i++){
        if($scope.imagearr[i]==''){
            $scope.imagearr.splice(i,1);
        }
    }   
  }
  if ($scope.a.city_project != undefined){
    if($scope.a.city_project == '0'){
      $scope.obj.isSelected = true;
    } else {
      $scope.obj.isSelected = false;
    }
  }
  if ($scope.a.project_build == '0') {
    $scope.a.project_build = '建设'
  } else if ($scope.a.project_build == '1') {
    $scope.a.project_build = '非建设'
  }
  if ($scope.a.project_level == '3') {
    $scope.a.project_level = '国家级'
  } else if ($scope.a.project_level == '2') {
    $scope.a.project_level = '省级'
  } if ($scope.a.project_level == '4') {
    $scope.a.project_level = '区域级'
  } else if ($scope.a.project_level == '1') {
    $scope.a.project_level = '市级'
  }


};
